﻿using FoursquareTask.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace FoursquareTask.DAL
{
    public class FoursquareInitializer : System.Data.Entity.DropCreateDatabaseIfModelChanges<FoursquareContext>
    {
        protected override void Seed(FoursquareContext context)
        {
            var searches = new List<Search>
            {
                new Search{Text="pegas", Count=2},
                new Search{Text="švejk", Count=3},
                new Search{Text="šutr", Count=8}
            };

            searches.ForEach(s => context.Searches.Add(s));
            context.SaveChanges();
        }
    }
}